package com.monitor.network;

/**
 * 注册接口响应数据模型
 */
public class RegistrationResponse {
    private int code;           // 响应状态码
    private String msg;         // 响应消息
    private RegistrationData data;  // 响应数据
    
    public int getCode() {
        return code;
    }
    
    public void setCode(int code) {
        this.code = code;
    }
    
    public String getMsg() {
        return msg;
    }
    
    public void setMsg(String msg) {
        this.msg = msg;
    }
    
    public RegistrationData getData() {
        return data;
    }
    
    public void setData(RegistrationData data) {
        this.data = data;
    }
    
    /**
     * 判断响应是否成功
     * @return 如果成功返回true，否则返回false
     */
    public boolean isSuccess() {
        return code == 200;
    }
    
    /**
     * 注册数据模型
     */
    public static class RegistrationData {
        private String deviceId;      // 设备ID
        private String token;         // 认证令牌
        private String refreshToken;  // 刷新令牌
        
        public String getDeviceId() {
            return deviceId;
        }
        
        public void setDeviceId(String deviceId) {
            this.deviceId = deviceId;
        }
        
        public String getToken() {
            return token;
        }
        
        public void setToken(String token) {
            this.token = token;
        }
        
        public String getRefreshToken() {
            return refreshToken;
        }
        
        public void setRefreshToken(String refreshToken) {
            this.refreshToken = refreshToken;
        }
    }
}